<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/init.jsp"%>

<script type="text/javascript">
	$(function() {
		$("#form1").validate({
			rules : {
				'uname' : {
					required : true
				},
				'code' : {
					required : true,
					minlength : 9,
					maxlength : 9,
					remote : { //验证用户名是否存在
						type : "POST",
						url : "${path}/ix/user/info/check_code.htm" //servlet
					}
				},
				'boeing' : {
					remote : { //验证用户名是否存在
						type : "POST",
						url : "${path}/ix/user/info/check_boeing.htm" //servlet
					}
				},
				'p_id' : {
					required : true
				},
				'phone' : {
					number : true
				},
				'role_id' : {
					required : true
				},
				'job_code' : {
					required : true
				},
				'bank_name' :{
					required : true
				}
			},
			messages : {
				code : {
					remote : "账号已存在，请重新输入"
				}
			}
		});
	});

	$(function(){
		var bank_id = $("input[name='bank_id']").val();
		if(bank_id==""){
			$("#mybank").html("<input type='text' name='bank_name' maxlength='30' onClick='getArea();' readonly />");
		}
	});
	function mySubmit() {
		$("#form1").submit();
	}
	
	function reg_finger(){
		DoTesoCmd(0,"fingerNote");
	}
</script>
<!-- 内容 -->
<div>
<jsp:include page="/WEB-INF/jsp/common/select_user_bank.jsp" />
	<form method="post" action="${path}/ix/user/info/add.htm" id="form1">
		<input type="hidden" id="mybank_id" name="bank_id" value="${bank._id}" />
		<h2>
			<div>新建人员信息</div>
		</h2>
		<table width="100%" class="lindex">
			<tr>
				<th align="right">人员代码：</th>
				<td align="left" colspan="2"><input name="code" type="text"
					maxlength="50" /></td>
				<th align="right">BoEing账号：</th>
				<td align="left" colspan="2"><input name="boeing" type="text"
					maxlength="100" /></td>
			</tr>
			<tr>
				<th align="right">人员名称：</th>
				<td align="left" colspan="2"><input name="uname" type="text"
					maxlength="50" /></td>
				<th align="right">身份证号：</th>
				<td align="left" colspan="2"><input name="p_id" type="text"
					maxlength="20" /></td>
			</tr>
			<tr>
				<th align="right">联系电话：</th>
				<td align="left" colspan="2"><input name="phone" type="text"
					maxlength="20" /></td>
				<th align="right">用户类型：</th>
				<td align="left" colspan="2"><input name="type" type="radio"
					value="一般用户" checked />一般用户&nbsp; <input name="type" type="radio"
					value="管理用户" />管理用户</td>
			</tr>

			<tr>
				<th align="right">所属机构：</th>
				<td align="left" colspan="2" id="mybank"><input type="text" maxlength="30"
					value="${bank.name}" readOnly /></td>
				<th align="right">职位：</th>
				<td align="left" colspan="2">
					<select name="job_code">
						<option value="">--请选择--</option>
						<c:forEach items="${jobList}" var="v">
						<option value="${v.code}">${v.name}</option>
						</c:forEach>
					</select>
				</td>
			</tr>

			<tr>
				<th align="right">登录方式：</th>
				<td align="left" colspan="2"><select name="login_type">
						<!-- <option value="生产库密码验证">生产库密码验证</option> -->
						<option value="生产库指纹验证">生产库指纹码验证</option>
						<!-- <option value="指纹验证">指纹验证</option> -->
						<option value="密码验证">密码验证</option>
				</select></td>
				<th align="right">主管级别：</th>
				<td align="left" colspan="2"><input name="user_level"
					type="radio" value="非主管" checked />非主管&nbsp; <input
					name="user_level" type="radio" value="三级主管" />三级主管</td>
			</tr>


			<tr>
				<th align="right">指纹：</th>
				<td align="left" colspan="2">
					<textarea id="fingerNote" readonly="readonly" name="note" rows="6" cols="50"></textarea>
					<button type="button" onclick="reg_finger()">录入指纹</button>
						
				</td>
				<th align="right">用户角色：</th>
				<td align="left" colspan="2"><select name="role_id">
						<c:forEach items="${role}" var="v">
							<option value="${v._id}">${v.name}</option>
						</c:forEach>
				</select></td>
			</tr>
		</table>
		<div class="options">
			<div>
				<a href="javascript:mySubmit();" class="asave"> 【保存】 </a>
			</div>
		</div>
	</form>
</div>
</body>
</html>